From 552be6b7d5bd807be071824439bab3f14738e053 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 19 Feb 2008 13:09:24 +0000 Subject: [PATCH] add some extra pixels outside the valid range to fix issues with wrong 2008-02-19 Sven Neumann * babl/babl-fish-path.c (test_create): add some extra pixels outside the valid range to fix issues with wrong clamping of conversions. svn path=/trunk/; revision=282 --- ChangeLog | 6 ++++++ babl/babl-fish-path.c | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6e6afa..eae0a18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-19 Sven Neumann + + * babl/babl-fish-path.c (test_create): add some extra pixels + outside the valid range to fix issues with wrong clamping of + conversions. + 2008-02-19 Sven Neumann * babl/babl-fish-path.c: renamed test_pixels to num_test_pixels. diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 6fd18f1..afbb1df 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -424,21 +424,30 @@ babl_fish_path_process (Babl *babl, } -#define num_test_pixels 128 +#define num_test_pixels (128 + 16 + 16) static double * test_create (void) { double *test; - int i; + int i, j; srandom (20050728); test = babl_malloc (sizeof (double) * num_test_pixels * 4); - for (i = 0; i < num_test_pixels * 4; i++) + /* add 128 pixels in the valid range between 0.0 and 1.0 */ + for (i = 0; i < 128 * 4; i++) test [i] = (double) random () / RAND_MAX; + /* add 16 pixels between -1.0 and 0.0 */ + for (j = 0; j < 16 * 4; i++, j++) + test [i] = 0.0 - (double) random () / RAND_MAX; + + /* add 16 pixels between 1.0 and 2.0 */ + for (j = 0; j < 16 * 4; i++, j++) + test [i] = 1.0 + (double) random () / RAND_MAX; + return test; } -- 2.30.2